package com.thor.palmmall.rest.process.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.process.AProcess;
import com.thor.palmmall.spi.process.SProcess;

public class SProcessConverter implements Converter<AProcess,SProcess> {
  public static SProcessConverter getInstance() {
    if (instance == null)
      instance = new SProcessConverter();
    return instance;
  }

  private static SProcessConverter instance;

  @Override
  public SProcess convert( AProcess source) {
    if (source == null) {
      return null;
    }
    SProcess target = new SProcess();
    target.setUserId(source.getUserId());
    target.setDefinitionKeys(source.getDefinitionKeys());
    return target;
  }
}
